package main

import (
	"gomicro/httpMicro/httpClient/controller"
	_ "gomicro/httpMicro/httpClient/controller"
	"log"
	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/mvc"

	"github.com/micro/go-micro/v2/web"
	"gomicro/httpMicro/httpClient/util"
	"github.com/micro/go-plugins/registry/etcdv3/v2"
)

func main() {
	
	util.EtcdRegistry = etcdv3.NewRegistry()

	service := web.NewService(
		web.Name("go.httpmicro.api.student.client"),
		web.Registry(util.EtcdRegistry),
	)

	service.Init()
	
	app := iris.New()
	mvc.New(app).Handle(new(controller.StudentMicroController))
	app.Run(iris.Addr(":8090"))

	service.Handle("/", app)

	if err := service.Run(); err != nil {
		log.Fatal(err)
	}

}

/*
自定义负载均衡：创建结构体，实现Selector接口，初始化 //micro.Selector(&结构体实例),
*/